<template>
  <!-- <div>
    <div class="index_banner" :class="showBanner ? 'on' : ''">
      <img :src="banner"/>
      <div class="close_btn">{{$t('page.index.close')}}<span class="iconfont icon-guanbi" @click="showBanner = false"></span></div>
    </div>
  </div> -->
</template>
<script>
// +----------------------------------------------------------------------
// | CRMEB [ CRMEB赋能开发者，助力企业发展 ]
// +----------------------------------------------------------------------
// | Copyright (c) 2016~2021 https://www.crmeb.com All rights reserved.
// +----------------------------------------------------------------------
// | Licensed CRMEB并不是自由软件，未经许可不能去掉CRMEB相关版权
// +----------------------------------------------------------------------
// | Author: CRMEB Team <admin@crmeb.com>
// +----------------------------------------------------------------------
    export default {
      name: "header_banner",
      mixins: [],
      data(){
        return{
          showBanner: false,
          banner: ""
        }
      },
      head() {
        return {

        }
      },
      beforeMount(){

      },
      mounted(){
        this.getBanner();
      },
      methods:{
        getBanner(){
          let that = this;
          that.$axios.get("/api/pc/home").then(res=>{
            that.banner = res.data.pc_top_banner.image;
            setTimeout(function(){
             that.showBanner = that.banner ? true : false;
             },200)
          })

        }


      }
    }
</script>

<style scoped lang="scss">
.index_banner{
  width: 100%;
  min-width: 1200px;
  position: relative;
  line-height: 0;
  transition: all 0.3s cubic-bezier(0.25, 0.5, 0.5, 0.9);
  transform: translate3d(0, -100%, 0);
  position: fixed;
  top: 0;
  left: 0;
  &.on{
    transform: translate3d(0, 0, 0);
    position: static;
    .close_btn{
      display: block;
    }
  }
}
.index_banner img{
  width: 100%;
  height: auto;
  animation: all .3s ease;
}
.index_banner .close_btn{
  font-size: 16px;
  position: absolute;
  line-height: 20px;
  right: 35px;
  top: 35px;
  color: #fff;
  padding: 3px 10px;
  border: 1px solid #fff;
  background-color: rgba(0,0,0,.6);
  border-radius: 24px;
  display: none;
  .iconfont{
    font-size: 14px;
    margin-left: 6px;
    cursor: pointer;
  }
}
</style>
